package connectionpool.internal;

import java.util.Properties;

/*****************************************************************************
 * @author amahmood
 * 
 ****************************************************************************/
public class DbProperties
{

    // Default properties
    private final static String DB_FRAMEWORK = "embedded";
    private final static String DB_PROTOCOL = "jdbc:derby";
    private final static String DB_USERNAME = "sa";
    private final static String DB_PASSWORD = "sa";

    private final static String DB_DRIVER = "org.apache.derby.jdbc.EmbeddedDriver";
    private final static String DB_PATH = "target";
    private final static String DB_NAME = "TestDB";
    private final static String DB_OPTIONS = "create=true";
    // private static String connectionURL = "jdbc:derby:" + dbName +
    // ";create=true";
    private final static String DB_CONNECTION_URL = DB_PROTOCOL + ":" + DB_PATH + "/" + DB_NAME + ";" + DB_OPTIONS;

    // private static String connectionURL =
    // "jdbc:derby:C:/Users/amahmood/MyDB;create=true";

    /*****************************************************************************
     * @return
     ****************************************************************************/
    public static Properties getDefaultProperties()
    {

        Properties out = new Properties();

        out.setProperty(DbPropertyNames.USERNAME.name(), DB_USERNAME);
        out.setProperty(DbPropertyNames.PASSWORD.name(), DB_PASSWORD);
        out.setProperty(DbPropertyNames.FRAMEWORK.name(), DB_FRAMEWORK);
        out.setProperty(DbPropertyNames.DRIVER.name(), DB_DRIVER);
        out.setProperty(DbPropertyNames.FILEPATH.name(), DB_PATH);
        out.setProperty(DbPropertyNames.OPTIONS.name(), DB_OPTIONS);
        out.setProperty(DbPropertyNames.NAME.name(), DB_NAME);
        out.setProperty(DbPropertyNames.PROTOCOL.name(), DB_PROTOCOL);
        out.setProperty(DbPropertyNames.URL.name(), DB_CONNECTION_URL);
        out.setProperty(DbPropertyNames.DEBUG.name(), Boolean.TRUE.toString());

        return out;
    }
}
